From d1420b07d9b66e7a7c94ec46a6df67e8652b61e1 Mon Sep 17 00:00:00 2001 From: robertl Date: Thu, 11 Mar 2004 14:53:00 +0000 Subject: [PATCH] Add month lookup, used by PCX. --- gpsbabel/util.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/gpsbabel/util.c b/gpsbabel/util.c index 8ac7d26c8..a50d9825d 100644 --- a/gpsbabel/util.c +++ b/gpsbabel/util.c @@ -449,6 +449,21 @@ get_tz_offset(void) } } +signed int +month_lookup(const char *m) +{ + static const char *months[] = { + "JAN", "FEB", "MAR", "APR", "MAY", "JUN", + "JUL", "AUG", "SEP", "OCT", "NOV", "DEC", NULL }; + const char **mp; + + for (mp = months; *mp; mp++) { + if (0 == case_ignore_strcmp(*mp, m)) + return mp - months; + } + return -1; +} + /* * Return a pointer to a constant string that is suitable for icon lookup * based on geocache attributes. The strings used are those present in @@ -585,7 +600,6 @@ strsub(char *s, char *search, char *replace) strcat(d, p + slen); return d; } - void utf8_to_int( const char *cp, int *bytes, int *value ) { -- 2.30.2